/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.suspend.floatwindow.floattingicon.a;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

public class a {
    private Context a;
    private static boolean b = false;
    private IntentFilter c;
    private b d;
    private a e;

    public a(Context paramContext) {
        this.a = paramContext;
    }

    public void a() {
        this.c = new IntentFilter("android.intent.action.CLOSE_SYSTEM_DIALOGS");
        this.e = new a();
        if (b)
            return;
        this.a.registerReceiver(this.e, this.c);
        b = true;
    }

    public void b() {
        if (this.e == null)
            return;
        try {
            if (b)
                this.a.unregisterReceiver(this.e);
            b = false;
        } catch (Exception localException) {
            localException.printStackTrace();
        }
    }

    public void a(b paramb) {
        this.d = paramb;
    }

    class a extends BroadcastReceiver {
        final String a = "reason";
        final String b = "homekey";
        final String c = "recentapps";

        public void onReceive(Context paramContext, Intent paramIntent) {
            String str1 = paramIntent.getAction();
            if (!(str1.equals("android.intent.action.CLOSE_SYSTEM_DIALOGS")))
                return;
            String str2 = paramIntent.getStringExtra("reason");
            if ((str2 == null) || (a.a(a.this) == null))
                return;
            if (str2.equals("homekey")) {
                a.a(a.this).a();
            }
            else {
                if (!(str2.equals("recentapps")))
                    return;
                a.a(a.this).b();
            }
        }
    }

    public static abstract interface b {
        public abstract void a();

        public abstract void b();
    }
}